package cn.iocoder.yudao.module.pay.dal.mysql.point;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pay.controller.app.point.vo.AppPayPointRechargePackagePageReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.point.PayPointRechargePackageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pay.controller.admin.point.vo.*;

/**
 * 充值套餐 Mapper
 *
 * @author Jerry
 */
@Mapper
public interface PayPointRechargePackageMapper extends BaseMapperX<PayPointRechargePackageDO> {

    default PageResult<PayPointRechargePackageDO> selectPage(PayPointRechargePackagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayPointRechargePackageDO>()
                .likeIfPresent(PayPointRechargePackageDO::getName, reqVO.getName())
                .eqIfPresent(PayPointRechargePackageDO::getPayPrice, reqVO.getPayPrice())
                .eqIfPresent(PayPointRechargePackageDO::getBonusPrice, reqVO.getBonusPrice())
                .eqIfPresent(PayPointRechargePackageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayPointRechargePackageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayPointRechargePackageDO::getId));
    }

    default PageResult<PayPointRechargePackageDO> selectPage(AppPayPointRechargePackagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayPointRechargePackageDO>()
                .likeIfPresent(PayPointRechargePackageDO::getName, reqVO.getName())
                .eqIfPresent(PayPointRechargePackageDO::getPayPrice, reqVO.getPayPrice())
                .eqIfPresent(PayPointRechargePackageDO::getBonusPrice, reqVO.getBonusPrice())
                .eqIfPresent(PayPointRechargePackageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayPointRechargePackageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayPointRechargePackageDO::getId));
    }

    default List<PayPointRechargePackageDO> selectListByStatus(Integer status){
        return selectList(PayPointRechargePackageDO::getStatus, status);
    }
}